package com.turing.post.antimoney.util;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

import com.turing.post.util.PCPSUtil;

/**
 * 预警信息明细表
 * 
 * @author 李治
 * 
 */
@SuppressWarnings("serial")
@Entity
@IdClass(AlarmInfoDetail.class)
@Table(name = "ALARMINFODETAIL")
public class AlarmInfoDetail implements Serializable {
	private BigInteger alarmInfoId;
	private Integer seqNo;
	private String businessType;
	private BigInteger businessOrderId;
	private String merchantNo;
	private Date tranDate;
	private String tranSeqNo;
	
	/**
	 * 预警信息明细业务类型 0 – 销售单
	 */
	public static final String ALARMINFODETAIL_BUSINESSTYPE_SALEORDER = "0";

	/**
	 * 预警信息明细业务类型 1 – 充值单
	 */
	public static final String ALARMINFODETAIL_BUSINESSTYPE_DEPOSITORDER = "1";
	

	/**
	 * 预警信息明细业务类型 2 – 赎回单
	 */
	public static final String ALARMINFODETAIL_BUSINESSTYPE_REDEMPORDER = "2";
	

	/**
	 * 预警信息明细业务类型 3 – 交易流水
	 */
	public static final String ALARMINFODETAIL_BUSINESSTYPE_TRADDETAIL = "3";
	
	@Id
	@Column(name = "ALARMINFOID", nullable = false)
	public BigInteger getAlarmInfoId() {
		return alarmInfoId;
	}

	public void setAlarmInfoId(BigInteger alarmInfoId) {
		this.alarmInfoId = alarmInfoId;
	}

	@Id
	@Column(name = "SEQNO", nullable = false)
	public Integer getSeqNo() {
		return seqNo;
	}

	public void setSeqNo(Integer seqNo) {
		this.seqNo = seqNo;
	}

	@Column(name = "BUSINESSTYPE", nullable = false)
	public String getBusinessType() {
		return businessType;
	}

	public void setBusinessType(String businessType) {
		this.businessType = businessType;
	}

	@Column(name = "BUSINESSORDERID")
	public BigInteger getBusinessOrderId() {
		return businessOrderId;
	}

	public void setBusinessOrderId(BigInteger businessOrderId) {
		this.businessOrderId = businessOrderId;
	}

	@Column(name = "MERCHANTNO")
	public String getMerchantNo() {
		return merchantNo;
	}

	public void setMerchantNo(String merchantNo) {
		this.merchantNo = merchantNo;
	}

	@Column(name = "TRANDATE")
	public Date getTranDate() {
		return tranDate;
	}

	public void setTranDate(Date tranDate) {
		this.tranDate = tranDate;
	}

	@Column(name = "TRANSEQNO")
	public String getTranSeqNo() {
		return tranSeqNo;
	}

	public void setTranSeqNo(String tranSeqNo) {
		this.tranSeqNo = tranSeqNo;
	}

	@Override
	public int hashCode() {
		return PCPSUtil.getObjectListHashCode(new Object[] { getAlarmInfoId(),
				getSeqNo() });
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof AlarmInfoDetail))
			return false;
		AlarmInfoDetail other = (AlarmInfoDetail) obj;
		if (!PCPSUtil.compareObject(this.getAlarmInfoId(), other
				.getAlarmInfoId()))
			return false;
		return PCPSUtil.compareObject(this.getSeqNo(), other.getSeqNo());
	}

}
